<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>pygccxml.declarations.filtering'</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pygccxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.language-binding.net">pygccxml</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="pygccxml-module.html">Package&nbsp;pygccxml</a> ::
        <a href="pygccxml.declarations-module.html">Package&nbsp;declarations</a> ::
        Module&nbsp;filtering'
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="pygccxml.declarations.filtering%27-module.html">Module pygccxml.declarations.filtering'</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-comment"># Copyright 2004-2008 Roman Yakovenko.</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Distributed under the Boost Software License, Version 1.0. (See</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># accompanying file LICENSE_1_0.txt or copy at</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># http://www.boost.org/LICENSE_1_0.txt)</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"><tt class="py-docstring">deprecated!</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-docstring">This module defines few algorithms for filtering declarations.</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">os</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt id="link-0" class="py-name" targets="Module pygccxml.declarations.algorithm=pygccxml.declarations.algorithm-module.html"><a title="pygccxml.declarations.algorithm" class="py-name" href="#" onclick="return doclink('link-0', 'algorithm', 'link-0');">algorithm</a></tt> </tt>
<a name="filtering"></a><div id="filtering-def"><a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line"> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt> <a class="py-toggle" href="#" id="filtering-toggle" onclick="return toggle('filtering');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pygccxml.declarations.filtering'.filtering-class.html">filtering</a><tt class="py-op">:</tt> </tt>
</div><div id="filtering-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="filtering-expanded"><a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line">    <tt class="py-docstring">"""deprecated!</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line"><tt class="py-docstring">    defines few algorithms for filtering declarations</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line"> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="filtering.normalize_path"></a><div id="filtering.normalize_path-def"><a name="L22"></a><tt class="py-lineno">22</tt> <a class="py-toggle" href="#" id="filtering.normalize_path-toggle" onclick="return toggle('filtering.normalize_path');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pygccxml.declarations.filtering'.filtering-class.html#normalize_path">normalize_path</a><tt class="py-op">(</tt> <tt class="py-param">some_path</tt> <tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="filtering.normalize_path-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="filtering.normalize_path-expanded"><a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line">        <tt class="py-docstring">"""return os.path.normcase( os.path.normpath( some_path ) )"""</tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Method pygccxml.msvc.bsc.module_t.path()=pygccxml.msvc.bsc.module_t-class.html#path,Method pygccxml.msvc.bsc_impl_details.module_t.path()=pygccxml.msvc.bsc_impl_details.module_t-class.html#path"><a title="pygccxml.msvc.bsc.module_t.path
pygccxml.msvc.bsc_impl_details.module_t.path" class="py-name" href="#" onclick="return doclink('link-1', 'path', 'link-1');">path</a></tt><tt class="py-op">.</tt><tt class="py-name">normcase</tt><tt class="py-op">(</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt id="link-2" class="py-name"><a title="pygccxml.msvc.bsc.module_t.path
pygccxml.msvc.bsc_impl_details.module_t.path" class="py-name" href="#" onclick="return doclink('link-2', 'path', 'link-1');">path</a></tt><tt class="py-op">.</tt><tt class="py-name">normpath</tt><tt class="py-op">(</tt> <tt class="py-name">some_path</tt> <tt class="py-op">)</tt> <tt class="py-op">)</tt> </tt>
</div><a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line"> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="filtering.contains_parent_dir"></a><div id="filtering.contains_parent_dir-def"><a name="L27"></a><tt class="py-lineno">27</tt> <a class="py-toggle" href="#" id="filtering.contains_parent_dir-toggle" onclick="return toggle('filtering.contains_parent_dir');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pygccxml.declarations.filtering'.filtering-class.html#contains_parent_dir">contains_parent_dir</a><tt class="py-op">(</tt> <tt class="py-param">fpath</tt><tt class="py-op">,</tt> <tt class="py-param">dirs</tt> <tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="filtering.contains_parent_dir-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="filtering.contains_parent_dir-expanded"><a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line">        <tt class="py-comment">#precondition: dirs and fpath should be normalize_path'ed before calling this function</tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">bool</tt><tt class="py-op">(</tt> <tt class="py-name">filter</tt><tt class="py-op">(</tt> <tt class="py-keyword">lambda</tt> <tt class="py-name">dir</tt><tt class="py-op">:</tt> <tt class="py-name">fpath</tt><tt class="py-op">.</tt><tt class="py-name">startswith</tt><tt class="py-op">(</tt> <tt class="py-name">dir</tt> <tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">dirs</tt> <tt class="py-op">)</tt> <tt class="py-op">)</tt> </tt>
</div><a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line"> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="filtering.by_location"></a><div id="filtering.by_location-def"><a name="L32"></a><tt class="py-lineno">32</tt> <a class="py-toggle" href="#" id="filtering.by_location-toggle" onclick="return toggle('filtering.by_location');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pygccxml.declarations.filtering'.filtering-class.html#by_location">by_location</a><tt class="py-op">(</tt> <tt class="py-param">decls</tt><tt class="py-op">,</tt> <tt class="py-param">locations</tt> <tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="filtering.by_location-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="filtering.by_location-expanded"><a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line"><tt class="py-docstring">        returns list of declarations that belongs to specified locations.</tt> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line"><tt class="py-docstring">        This function works recursively. Pay attention: if you remove namespace,</tt> </tt>
<a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line"><tt class="py-docstring">        then you remove all declarations defined within the namespace.</tt> </tt>
<a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line"><tt class="py-docstring">        @param decls: declaration or list of declarations</tt> </tt>
<a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line"><tt class="py-docstring">        @type decls: L{declaration&lt;declaration_t&gt;} or list of L{declarations&lt;declaration_t&gt;}</tt> </tt>
<a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line"><tt class="py-docstring">        @param locations: list of directories and/or files names</tt> </tt>
<a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line"><tt class="py-docstring">        @type locations: list of strings</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line"><tt class="py-docstring">        @return: list of L{declarations&lt;declaration_t&gt;}</tt> </tt>
<a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line">        <tt class="py-comment">#precondition: decls is a list of op level namespaces</tt> </tt>
<a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#locations is list of directories and\or files</tt> </tt>
<a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">temp_decls</tt> <tt class="py-op">=</tt> <tt id="link-3" class="py-name"><a title="pygccxml.declarations.algorithm" class="py-name" href="#" onclick="return doclink('link-3', 'algorithm', 'link-0');">algorithm</a></tt><tt class="py-op">.</tt><tt id="link-4" class="py-name" targets="Function pygccxml.declarations.algorithm.make_flatten()=pygccxml.declarations.algorithm-module.html#make_flatten"><a title="pygccxml.declarations.algorithm.make_flatten" class="py-name" href="#" onclick="return doclink('link-4', 'make_flatten', 'link-4');">make_flatten</a></tt><tt class="py-op">(</tt> <tt id="link-5" class="py-name" targets="Method pygccxml.declarations.scopedef.scopedef_t.decls()=pygccxml.declarations.scopedef.scopedef_t-class.html#decls"><a title="pygccxml.declarations.scopedef.scopedef_t.decls" class="py-name" href="#" onclick="return doclink('link-5', 'decls', 'link-5');">decls</a></tt> <tt class="py-op">)</tt> </tt>
<a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line">        <tt class="py-name">locations</tt> <tt class="py-op">=</tt> <tt class="py-name">map</tt><tt class="py-op">(</tt> <tt id="link-6" class="py-name" targets="Class pygccxml.declarations.filtering'.filtering=pygccxml.declarations.filtering%27.filtering-class.html"><a title="pygccxml.declarations.filtering'.filtering" class="py-name" href="#" onclick="return doclink('link-6', 'filtering', 'link-6');">filtering</a></tt><tt class="py-op">.</tt><tt id="link-7" class="py-name" targets="Static Method pygccxml.declarations.filtering'.filtering.normalize_path()=pygccxml.declarations.filtering%27.filtering-class.html#normalize_path,Function pygccxml.utils.normalize_path()=pygccxml.utils-module.html#normalize_path"><a title="pygccxml.declarations.filtering'.filtering.normalize_path
pygccxml.utils.normalize_path" class="py-name" href="#" onclick="return doclink('link-7', 'normalize_path', 'link-7');">normalize_path</a></tt><tt class="py-op">,</tt> <tt class="py-name">locations</tt> <tt class="py-op">)</tt> </tt>
<a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">        <tt class="py-name">dirs</tt> <tt class="py-op">=</tt> <tt class="py-name">filter</tt><tt class="py-op">(</tt> <tt class="py-keyword">lambda</tt> <tt id="link-8" class="py-name" targets="Variable pygccxml.declarations.declaration.declaration_t.location=pygccxml.declarations.declaration.declaration_t-class.html#location,Method pygccxml.msvc.bsc.definition_t.location()=pygccxml.msvc.bsc.definition_t-class.html#location,Method pygccxml.msvc.bsc_impl_details.definition_t.location()=pygccxml.msvc.bsc_impl_details.definition_t-class.html#location"><a title="pygccxml.declarations.declaration.declaration_t.location
pygccxml.msvc.bsc.definition_t.location
pygccxml.msvc.bsc_impl_details.definition_t.location" class="py-name" href="#" onclick="return doclink('link-8', 'location', 'link-8');">location</a></tt><tt class="py-op">:</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="pygccxml.msvc.bsc.module_t.path
pygccxml.msvc.bsc_impl_details.module_t.path" class="py-name" href="#" onclick="return doclink('link-9', 'path', 'link-1');">path</a></tt><tt class="py-op">.</tt><tt class="py-name">isdir</tt><tt class="py-op">(</tt> <tt id="link-10" class="py-name"><a title="pygccxml.declarations.declaration.declaration_t.location
pygccxml.msvc.bsc.definition_t.location
pygccxml.msvc.bsc_impl_details.definition_t.location" class="py-name" href="#" onclick="return doclink('link-10', 'location', 'link-8');">location</a></tt> <tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">locations</tt> <tt class="py-op">)</tt> </tt>
<a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line">        <tt id="link-11" class="py-name" targets="Method pygccxml.msvc.bsc.reader_t.files()=pygccxml.msvc.bsc.reader_t-class.html#files,Method pygccxml.msvc.bsc_impl_details.bsc_reader_t.files()=pygccxml.msvc.bsc_impl_details.bsc_reader_t-class.html#files,Method pygccxml.parser.scanner.scanner_t.files()=pygccxml.parser.scanner.scanner_t-class.html#files"><a title="pygccxml.msvc.bsc.reader_t.files
pygccxml.msvc.bsc_impl_details.bsc_reader_t.files
pygccxml.parser.scanner.scanner_t.files" class="py-name" href="#" onclick="return doclink('link-11', 'files', 'link-11');">files</a></tt> <tt class="py-op">=</tt> <tt class="py-name">filter</tt><tt class="py-op">(</tt> <tt class="py-keyword">lambda</tt> <tt id="link-12" class="py-name"><a title="pygccxml.declarations.declaration.declaration_t.location
pygccxml.msvc.bsc.definition_t.location
pygccxml.msvc.bsc_impl_details.definition_t.location" class="py-name" href="#" onclick="return doclink('link-12', 'location', 'link-8');">location</a></tt><tt class="py-op">:</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name"><a title="pygccxml.msvc.bsc.module_t.path
pygccxml.msvc.bsc_impl_details.module_t.path" class="py-name" href="#" onclick="return doclink('link-13', 'path', 'link-1');">path</a></tt><tt class="py-op">.</tt><tt class="py-name">isfile</tt><tt class="py-op">(</tt> <tt id="link-14" class="py-name"><a title="pygccxml.declarations.declaration.declaration_t.location
pygccxml.msvc.bsc.definition_t.location
pygccxml.msvc.bsc_impl_details.definition_t.location" class="py-name" href="#" onclick="return doclink('link-14', 'location', 'link-8');">location</a></tt> <tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">locations</tt> <tt class="py-op">)</tt> </tt>
<a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line">        <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt id="link-15" class="py-name" targets="Method pygccxml.declarations.scopedef.scopedef_t.decl()=pygccxml.declarations.scopedef.scopedef_t-class.html#decl"><a title="pygccxml.declarations.scopedef.scopedef_t.decl" class="py-name" href="#" onclick="return doclink('link-15', 'decl', 'link-15');">decl</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">temp_decls</tt><tt class="py-op">:</tt> </tt>
<a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt id="link-16" class="py-name"><a title="pygccxml.declarations.scopedef.scopedef_t.decl" class="py-name" href="#" onclick="return doclink('link-16', 'decl', 'link-15');">decl</a></tt><tt class="py-op">.</tt><tt id="link-17" class="py-name"><a title="pygccxml.declarations.declaration.declaration_t.location
pygccxml.msvc.bsc.definition_t.location
pygccxml.msvc.bsc_impl_details.definition_t.location" class="py-name" href="#" onclick="return doclink('link-17', 'location', 'link-8');">location</a></tt><tt class="py-op">:</tt> </tt>
<a name="L56"></a><tt class="py-lineno">56</tt>  <tt class="py-line">                <tt class="py-name">result</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt id="link-18" class="py-name"><a title="pygccxml.declarations.scopedef.scopedef_t.decl" class="py-name" href="#" onclick="return doclink('link-18', 'decl', 'link-15');">decl</a></tt> <tt class="py-op">)</tt> </tt>
<a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line">                <tt class="py-keyword">continue</tt> </tt>
<a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line">            <tt class="py-name">fpath</tt> <tt class="py-op">=</tt> <tt id="link-19" class="py-name"><a title="pygccxml.declarations.filtering'.filtering" class="py-name" href="#" onclick="return doclink('link-19', 'filtering', 'link-6');">filtering</a></tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="pygccxml.declarations.filtering'.filtering.normalize_path
pygccxml.utils.normalize_path" class="py-name" href="#" onclick="return doclink('link-20', 'normalize_path', 'link-7');">normalize_path</a></tt><tt class="py-op">(</tt> <tt id="link-21" class="py-name"><a title="pygccxml.declarations.scopedef.scopedef_t.decl" class="py-name" href="#" onclick="return doclink('link-21', 'decl', 'link-15');">decl</a></tt><tt class="py-op">.</tt><tt id="link-22" class="py-name"><a title="pygccxml.declarations.declaration.declaration_t.location
pygccxml.msvc.bsc.definition_t.location
pygccxml.msvc.bsc_impl_details.definition_t.location" class="py-name" href="#" onclick="return doclink('link-22', 'location', 'link-8');">location</a></tt><tt class="py-op">.</tt><tt id="link-23" class="py-name" targets="Variable pygccxml.declarations.declaration.location_t.file_name=pygccxml.declarations.declaration.location_t-class.html#file_name,Method pygccxml.msvc.bsc.definition_t.file_name()=pygccxml.msvc.bsc.definition_t-class.html#file_name,Method pygccxml.msvc.bsc_impl_details.definition_t.file_name()=pygccxml.msvc.bsc_impl_details.definition_t-class.html#file_name"><a title="pygccxml.declarations.declaration.location_t.file_name
pygccxml.msvc.bsc.definition_t.file_name
pygccxml.msvc.bsc_impl_details.definition_t.file_name" class="py-name" href="#" onclick="return doclink('link-23', 'file_name', 'link-23');">file_name</a></tt> <tt class="py-op">)</tt> </tt>
<a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt id="link-24" class="py-name"><a title="pygccxml.declarations.filtering'.filtering" class="py-name" href="#" onclick="return doclink('link-24', 'filtering', 'link-6');">filtering</a></tt><tt class="py-op">.</tt><tt id="link-25" class="py-name" targets="Static Method pygccxml.declarations.filtering'.filtering.contains_parent_dir()=pygccxml.declarations.filtering%27.filtering-class.html#contains_parent_dir"><a title="pygccxml.declarations.filtering'.filtering.contains_parent_dir" class="py-name" href="#" onclick="return doclink('link-25', 'contains_parent_dir', 'link-25');">contains_parent_dir</a></tt><tt class="py-op">(</tt> <tt class="py-name">fpath</tt><tt class="py-op">,</tt> <tt class="py-name">dirs</tt> <tt class="py-op">)</tt> <tt class="py-keyword">or</tt> <tt class="py-name">fpath</tt> <tt class="py-keyword">in</tt> <tt id="link-26" class="py-name"><a title="pygccxml.msvc.bsc.reader_t.files
pygccxml.msvc.bsc_impl_details.bsc_reader_t.files
pygccxml.parser.scanner.scanner_t.files" class="py-name" href="#" onclick="return doclink('link-26', 'files', 'link-11');">files</a></tt><tt class="py-op">:</tt> </tt>
<a name="L60"></a><tt class="py-lineno">60</tt>  <tt class="py-line">                <tt class="py-name">result</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt id="link-27" class="py-name"><a title="pygccxml.declarations.scopedef.scopedef_t.decl" class="py-name" href="#" onclick="return doclink('link-27', 'decl', 'link-15');">decl</a></tt> <tt class="py-op">)</tt> </tt>
<a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">result</tt> </tt>
</div><a name="L62"></a><tt class="py-lineno">62</tt>  <tt class="py-line"> </tt>
<a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line">    <tt class="py-decorator">@</tt><tt class="py-decorator">staticmethod</tt> </tt>
<a name="filtering.user_defined"></a><div id="filtering.user_defined-def"><a name="L64"></a><tt class="py-lineno">64</tt> <a class="py-toggle" href="#" id="filtering.user_defined-toggle" onclick="return toggle('filtering.user_defined');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="pygccxml.declarations.filtering'.filtering-class.html#user_defined">user_defined</a><tt class="py-op">(</tt> <tt class="py-param">decls</tt><tt class="py-op">,</tt> <tt class="py-param">matcher</tt> <tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="filtering.user_defined-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="filtering.user_defined-expanded"><a name="L65"></a><tt class="py-lineno">65</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L66"></a><tt class="py-lineno">66</tt>  <tt class="py-line"><tt class="py-docstring">        returns list of declarations that match user specified criteria.</tt> </tt>
<a name="L67"></a><tt class="py-lineno">67</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L68"></a><tt class="py-lineno">68</tt>  <tt class="py-line"><tt class="py-docstring">        This function works recursively.</tt> </tt>
<a name="L69"></a><tt class="py-lineno">69</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L70"></a><tt class="py-lineno">70</tt>  <tt class="py-line"><tt class="py-docstring">        @param decls: declaration or list of declarations</tt> </tt>
<a name="L71"></a><tt class="py-lineno">71</tt>  <tt class="py-line"><tt class="py-docstring">        @type decls: L{declaration&lt;declaration_t&gt;} or list of L{declarations&lt;declaration_t&gt;}</tt> </tt>
<a name="L72"></a><tt class="py-lineno">72</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L73"></a><tt class="py-lineno">73</tt>  <tt class="py-line"><tt class="py-docstring">        @param matcher: callable object, that takes 1 argument - declaration</tt> </tt>
<a name="L74"></a><tt class="py-lineno">74</tt>  <tt class="py-line"><tt class="py-docstring">                        and returns True if object should stay, and false otherwise</tt> </tt>
<a name="L75"></a><tt class="py-lineno">75</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L76"></a><tt class="py-lineno">76</tt>  <tt class="py-line"><tt class="py-docstring">        @return: list of L{declarations&lt;declaration_t&gt;}</tt> </tt>
<a name="L77"></a><tt class="py-lineno">77</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L78"></a><tt class="py-lineno">78</tt>  <tt class="py-line">        <tt class="py-comment">#precondition: decls is a list of op level namespaces</tt> </tt>
<a name="L79"></a><tt class="py-lineno">79</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">filter</tt><tt class="py-op">(</tt> <tt id="link-28" class="py-name" targets="Class pygccxml.declarations.matcher'.matcher=pygccxml.declarations.matcher%27.matcher-class.html"><a title="pygccxml.declarations.matcher'.matcher" class="py-name" href="#" onclick="return doclink('link-28', 'matcher', 'link-28');">matcher</a></tt><tt class="py-op">,</tt> <tt id="link-29" class="py-name"><a title="pygccxml.declarations.algorithm" class="py-name" href="#" onclick="return doclink('link-29', 'algorithm', 'link-0');">algorithm</a></tt><tt class="py-op">.</tt><tt id="link-30" class="py-name"><a title="pygccxml.declarations.algorithm.make_flatten" class="py-name" href="#" onclick="return doclink('link-30', 'make_flatten', 'link-4');">make_flatten</a></tt><tt class="py-op">(</tt> <tt id="link-31" class="py-name"><a title="pygccxml.declarations.scopedef.scopedef_t.decls" class="py-name" href="#" onclick="return doclink('link-31', 'decls', 'link-5');">decls</a></tt> <tt class="py-op">)</tt> <tt class="py-op">)</tt> </tt>
</div></div><a name="L80"></a><tt class="py-lineno">80</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="pygccxml-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.language-binding.net">pygccxml</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1
    on Mon Oct 20 09:00:33 2008
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
